syn keyword htmlArg contained size src start target text type url
syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
syn match htmlArg contained "http-equiv"
" Netscape extensions
syn keyword htmlTagName contained frame frameset nobr span
syn keyword htmlTagName contained layer ilayer nolayer spacer
syn keyword htmlArg contained frameborder noresize pagex pagey above below
syn keyword htmlArg contained left top visibility clip id noshade
syn match htmlArg contained "z-index"
" special characters
syn match htmlSpecialChar "&[^;]*;"
" server-parsed commands
syn region htmlPreProc start=+<!--#+ end=+-->+
" The real comments (this implements the comments as defined by html,
" but not all html pages actually conform to it. Errors are flagged.
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError
syn region htmlComment start=+<!DOCTYPE+ end=+>+
syn match htmlCommentError contained "[^><!]"
syn region htmlCommentPart contained start=+--+ end=+--+
" JAVA SCRIPT
syn keyword htmlTagName contained noscript
" html events (i.e. arguments that include javascript commands)
syn region htmlEvent contained start=+on[a-z]\+\s*=[\t ]*'+ skip=+\\\\\|\\'+ end=+'+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringD,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen,javaScriptParenError
syn region htmlEvent contained start=+on[a-z]\+\s*=[\t ]*"+ skip=+\\\\\|\\"+ end=+"+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen,javaScriptParenError
" a javascript expression is used as an arg value
syn region javaScriptExpression start=+&{+ end=+};+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaScriptStringD,javaStringCharacter,javaScriptSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptBoolean,javaScriptFunction
" javascript starts with <SCRIPT and ends with </SCRIPT>
syn region javaScript start=+<script+ end=+</script>+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaScriptStringD,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen,javaScriptParenError
syn match javaScriptLineComment contained "\/\/.*$"
syn match javaScriptCommentSkip contained "^\s*\*\($\|\s\+\)"
syn region javaScriptCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=javaScriptSpecial,javaScriptCommentSkip
syn region javaScriptComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+$\|"+ contains=javaScriptSpecial
syn region javaScriptComment contained start="/\*" end="\*/" contains=javaScriptCommentString,javaScriptCharacter,javaScriptNumber
syn match javaScriptSpecial contained "\\[0-9][0-9][0-9]\|\\."
syn region javaScriptStringD contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=javaScriptSpecial
syn region javaScriptStringS contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=javaScriptSpecial
syn match javaScriptSpecialCharacter contained "'\\.'"
syn match javaScriptNumber contained "-\=\<[0-9]\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn keyword javaScriptConditional contained if else
syn keyword javaScriptRepeat contained while for
syn keyword javaScriptBranch contained break continue
syn keyword javaScriptOperator contained new in
syn keyword javaScriptType contained this var
syn keyword javaScriptStatement contained return with
syn keyword javaScriptFunction contained function
syn keyword javaScriptBoolean contained true false
syn match javaScriptBraces contained "[{}]"
" catch errors caused by wrong parenthesis
syn region javaScriptParen contained start="(" end=")" contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaScriptStringD,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen
syn match javaScriptParenError contained ")"
syn match javaScriptInParen contained "[{}]"
" synchronizing (does not always work if a comment includes legal
" html tags, but doing it right would mean to always start
" at the first line, which is too slow)
syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
syn sync match htmlHighlight groupthere javaScript "<script"
syn sync match htmlHighlightSkip "^.*['\"].*$"
syn sync minlines=10
if !exists("did_html_syntax_inits")
let did_html_syntax_inits = 1
" The default methods for highlighting. Can be overridden later
hi link htmlTag Function
hi link htmlEndTag Identifier
hi link htmlArg Type
hi link htmlTagName htmlStatement
hi link htmlValue Value
hi link htmlSpecialChar Special
hi link htmlSpecial Special
hi link htmlSpecialChar Special
hi link htmlString String
hi link htmlStatement Statement
hi link htmlComment Comment
hi link htmlCommentPart Comment
hi link htmlPreProc PreProc
hi link htmlValue String
hi link htmlCommentError htmlError
hi link htmlTagError htmlError
hi link htmlEvent javaScript
hi link htmlError Error
hi link javaScript Special
hi link javaScriptExpression javaScript
hi link javaScriptComment Comment
hi link javaScriptLineComment Comment
hi link javaScriptSpecial javaScript
hi link javaScriptStringS String
hi link javaScriptStringD String
hi link javaScriptCharacter Character
hi link javaScriptSpecialCharacter javaScriptSpecial